<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QSvgWidget Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QSvgWidget Class Reference<br /><sup><sup>[<a href="qtsvg.html">QtSvg</a> module]</sup></sup></h1><p>The QSvgWidget class provides a widget that is used to display
the contents of Scalable Vector Graphics (SVG) files. <a href="#details">More...</a></p>

<p>Inherits <a href="qwidget.html">QWidget</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qsvgwidget.html#QSvgWidget">__init__</a></b> (<i>self</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qsvgwidget.html#QSvgWidget-2">__init__</a></b> (<i>self</i>, QString&#160;<i>file</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qsvgwidget.html#load">load</a></b> (<i>self</i>, QString&#160;<i>file</i>)</li><li><div class="fn" /><b><a href="qsvgwidget.html#load-2">load</a></b> (<i>self</i>, QByteArray&#160;<i>contents</i>)</li><li><div class="fn" /><b><a href="qsvgwidget.html#paintEvent">paintEvent</a></b> (<i>self</i>, QPaintEvent&#160;<i>event</i>)</li><li><div class="fn" />QSvgRenderer <b><a href="qsvgwidget.html#renderer">renderer</a></b> (<i>self</i>)</li><li><div class="fn" />QSize <b><a href="qsvgwidget.html#sizeHint">sizeHint</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QSvgWidget class provides a widget that is used to display
the contents of Scalable Vector Graphics (SVG) files.</p>
<p>This class enables developers to display SVG drawings alongside
standard widgets, and is used in much the same way as <a href="qlabel.html">QLabel</a> is used for displaying text and bitmap
images.</p>
<p>Since QSvgWidget is a subclass of <a href="qwidget.html">QWidget</a>, SVG drawings are rendered using the
properties of the display. More control can be exercised over the
rendering process with the <a href="qsvgrenderer.html">QSvgRenderer</a> class, as this can be used to
paint onto other paint devices, such as <a href="qimage.html">QImage</a> and <a href="qglwidget.html">QGLWidget</a>. The renderer used by the widget can
be obtained with the <a href="qsvgwidget.html#renderer">renderer</a>() function.</p>
<p>Each QSvgWidget can be constructed with the file name of a SVG
file, or they can be constructed without a specific file to render
and one can be supplied later. The <a href="qsvgwidget.html#load">load</a>() functions provide two different
ways to load an SVG file: they accept either the file name of an
SVG file or a <a href="qbytearray.html">QByteArray</a> containing
the serialized XML representation of an SVG file.</p>
<p>By default, the widget provides a size hint to reflect the size
of the drawing that it displays. If no data has been loaded, the
widget provides the default <a href="qwidget.html">QWidget</a> size
hint. Subclass this class and reimplement <a href="qsvgwidget.html#sizeHint">sizeHint</a>() if you need to customize
this behavior.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QSvgWidget" />QSvgWidget.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a new SVG display widget with the given
<i>parent</i>.</p>


<h3 class="fn"><a name="QSvgWidget-2" />QSvgWidget.__init__ (<i>self</i>, QString&#160;<i>file</i>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a new SVG display widget with the given <i>parent</i>
and loads the contents of the specified <i>file</i>.</p>


<h3 class="fn"><a name="load" />QSvgWidget.load (<i>self</i>, QString&#160;<i>file</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void load(const QString&amp;)</tt>.</p><p>Loads the contents of the specified SVG <i>file</i> and updates
the widget.</p>


<h3 class="fn"><a name="load-2" />QSvgWidget.load (<i>self</i>, <a href="qbytearray.html">QByteArray</a>&#160;<i>contents</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void load(const QByteArray&amp;)</tt>.</p><p>Loads the specified SVG format <i>contents</i> and updates the
widget.</p>


<h3 class="fn"><a name="paintEvent" />QSvgWidget.paintEvent (<i>self</i>, <a href="qpaintevent.html">QPaintEvent</a>&#160;<i>event</i>)</h3><p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget.paintEvent</a>().</p>


<h3 class="fn"><a name="renderer" /><a href="qsvgrenderer.html">QSvgRenderer</a> QSvgWidget.renderer (<i>self</i>)</h3><p>Returns the renderer used to display the contents of the
widget.</p>


<h3 class="fn"><a name="sizeHint" /><a href="qsize.html">QSize</a> QSvgWidget.sizeHint (<i>self</i>)</h3><p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget.sizeHint</a>().</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.8.0</td></tr></table></div></address></body></html>